package com.yuju.order.enums;

/**
 * 
 * 类名：reserveReturnCodeEnum  <br />
 *
 * 功能：功能：预订业务代码枚举
 *
 * @author : sunyl <br />
 * @Date : 2017年11月23日 上午10:40:51  <br />
 * @version : 1.1 <br />
 */
public enum ReserveReturnCodeEnum {
	RESERVE_QUERY_SUCCESS("yuju-reserve-1000", "预订信息查询成功"),
	RESERVE_QUERY_FAILURE("yuju-reserve-1001", "预订信息查询失败"),
	RESERVE_SAVE_SUCCESS("yuju-reserve-1002", "预订信息保存成功"),
	RESERVE_SAVE_FAILURE("yuju-reserve-1003", "预订信息保存失败"),
	RESERVE_UPDATE_SUCCESS("yuju-reserve-1004", "预订信息更新成功"),
	RESERVE_UPDATE_FAILURE("yuju-reserve-1005", "预订信息更新失败"),
	RESERVE_DEL_SUCCESS("yuju-reserve-1006", "预订信息删除成功"),
	RESERVE_DEL_FAILURE("yuju-reserve-1007", "预订信息删除失败"),
	RESERVE_CANCEL_SUCCESS("yuju-reserve-1008", "预订信息取消成功"),
	RESERVE_CANCEL_FAILURE("yuju-reserve-1009", "预订信息取消失败"),
	RESERVE_RECOVER_SUCCESS("yuju-reserve-1010", "预订信息恢复成功"),
	RESERVE_RECOVER_FAILURE("yuju-reserve-1011", "预订信息恢复失败"),
	RESERVE_ROOM_CHECK_FAILURE("yuju-reserve-1012", "预订所选房间校验失败"),
	RESERVE_ROOM_HAVING_PAY("yuju-reserve-1013", "预订单状态为");
	
	private String code;
	private String desc;
	
	ReserveReturnCodeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static String getDescByCode(String code) {
		for (ReserveReturnCodeEnum enume : ReserveReturnCodeEnum.values()) {
			if (enume.getCode().equals(code)) {
				return enume.getDesc();
			}
		}
		
		return "未知枚举类型";
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}